<template>
	<view class="tea-hill w100 df-y">
		<view @click="jump('/pages/public/page-details',{id:item1.id})" class="items mb30 df-y"
			v-for="(item1,index1) in teaHillData" :key="index1">
			<swiper :id="'swiper'+index1" style="height: 260rpx;" :autoplay="true" class='swiper' @change="changeSwiperBox" :interval="3000"
				:duration="1000">
				<swiper-item v-for="(item2,index2) in item1.images" :key="index2">
					<view class="swiper-item">
						<image :src="imgurl+item2" mode="widthFix"></image>
					</view>
				</swiper-item>
			</swiper>
			<view class="swiper_text bs pa30 df-y">
				<view class="swiper_title">{{item1.name}}</view>
				<view class="swiper_content">
					{{item1.description}}
				</view>
			</view>
			<view class="indicator DIN">{{currentBox['swiper'+index1]==undefined?1:currentBox['swiper'+index1]+1}} /
				{{item1.images.length}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'teaHill',
		data: function() {
			return {
				currentBox: {},
				imgurl: this.$IMG_URL,

			}
		},
		computed: {
			teaHillData() {
				return this.$store.state.init.teaHillData
				
			}
		},
		methods: {
			changeSwiperBox(i) {
				this.$set(this.currentBox,i.target.id,i.detail.current)
			},
			jump(path, params) {
				this.$Router.push({
					path: path,
					params: params
				})
			}
		},
		created() {

		},
		watch: {},
		mounted() {},
	}
</script>

<style scoped lang="scss">
	.tea-hill {}

	.items {
		width: 690rpx;
		border-radius: 20rpx;
		position: relative;
		overflow: hidden;

		.swiper_text {
			width: 100%;
			background-color: #FFFFFF;
			font-weight:400;

			.swiper_title {
				font-size: 50rpx;
				font-family: Source Han Serif CN;
				font-weight: bold;
				color: #333333;
				margin: 47rpx 0;
			}
		}

		.swiper {
			height: 260rpx;
			width: 100%;

			.swiper-item {
				width: 100%;
				height: 100%;
				background-color: #ECF5FF;
			}
		}

		.indicator {
			width: 73rpx;
			height: 33rpx;
			background-color: #000000;
			opacity: 0.4;
			border-radius: 17rpx;
			position: absolute;
			left: 40rpx;
			top: 198rpx;
			color: #FFFFFF;
			font-size: 22rpx;
			font-family: HyFTeaTime;
			line-height: 33rpx;
			text-align: center;
		}
	}
</style>
